home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / OS / FWMemory / Include / FWBestFH.h next >
Encoding:
Text File  |  1994-04-21  |  19.3 KB  |  587 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWBestFH.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/28/94
  7. //
  8. //    Copyright:    © 1993, 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWBESTFH_H
  13. #define FWBESTFH_H
  14.  
  15. #ifndef FWMEMORH_H
  16. #include <FWMemorH.h>
  17. #endif
  18.  
  19.  
  20. //========================================================================================
  21. // Forward class declarations
  22. //========================================================================================
  23.  
  24. class FW_CPrivBestFitBlock;
  25. class FW_CBestFitHeap;
  26.  
  27.  
  28. //========================================================================================
  29. // STRUCT FW_SPrivBestFitBlockFreeListLinks
  30. //
  31. // The following fields are only present in free blocks. They are used to link the free
  32. // block into the free block tree. The address of a free block is also stored at the end
  33. // of the block and must be accounted for in the minimum block size.
  34. //========================================================================================
  35.  
  36. struct FW_SPrivBestFitBlockFreeListLinks
  37. {
  38.     FW_CPrivBestFitBlock* fParent;
  39.     FW_CPrivBestFitBlock* fLeft;
  40.     FW_CPrivBestFitBlock* fRight;
  41. };
  42.  
  43.  
  44. //========================================================================================
  45. // STRUCT FW_SPrivBestFitBlockHeader
  46. //========================================================================================
  47.  
  48. // The fBits field of FW_SPrivBestFitBlockHeader contains five fields. The following masks are
  49. // used to get and set the fields. The block type field is used to distinguish best fit
  50. // blocks from chunky blocks and must be the first four bits of the last byte in fBits.
  51.  
  52. #ifdef BUILD_WIN
  53. // Bytes are in reverse order in a long.
  54.  
  55. const unsigned long BestFitBlockHeader_kSizeMask = 0x00FFFFFF;
  56. const unsigned long BestFitBlockHeader_kSizeShift = 0;
  57.  
  58. const unsigned long BestFitBlockHeader_kBlockTypeMask = 0xF0000000;
  59. const unsigned long BestFitBlockHeader_kBlockTypeShift = 28;
  60.  
  61. const unsigned long BestFitBlockHeader_kBusyMask = 0x08000000;
  62. const unsigned long BestFitBlockHeader_kBusyShift = 27;
  63.  
  64. const unsigned long BestFitBlockHeader_kPreviousBusyMask = 0x04000000;
  65. const unsigned long BestFitBlockHeader_kPreviousBusyShift = 26;
  66.  
  67. const unsigned long BestFitBlockHeader_kMagicNumberMask = 0x03000000;
  68. const unsigned long BestFitBlockHeader_kMagicNumberShift = 24;
  69. #else
  70. const unsigned long BestFitBlockHeader_kSizeMask = 0xFFFFFF00;
  71. const unsigned long BestFitBlockHeader_kSizeShift = 8;
  72.  
  73. const unsigned long BestFitBlockHeader_kBlockTypeMask = 0x000000F0;
  74. const unsigned long BestFitBlockHeader_kBlockTypeShift = 4;
  75.  
  76. const unsigned long BestFitBlockHeader_kBusyMask = 0x00000008;
  77. const unsigned long BestFitBlockHeader_kBusyShift = 3;
  78.  
  79. const unsigned long BestFitBlockHeader_kPreviousBusyMask = 0x00000004;
  80. const unsigned long BestFitBlockHeader_kPreviousBusyShift = 2;
  81.  
  82. const unsigned long BestFitBlockHeader_kMagicNumberMask = 0x00000003;
  83. const unsigned long BestFitBlockHeader_kMagicNumberShift = 0;
  84. #endif
  85.  
  86. struct FW_SPrivBestFitBlockHeader
  87. {
  88.     unsigned long fBits;
  89.     FW_SPrivBestFitBlockFreeListLinks fFreeLinks;
  90. };
  91.  
  92.  
  93. //========================================================================================
  94. // CLASS FW_CPrivBestFitBlock
  95. //========================================================================================
  96.  
  97. #ifdef BUILD_WIN16
  98. const FW_BlockSize BestFitBlock_kMaxBlockSize = 60L * 1024L;
  99.     // Block size limited by 64K limit of far pointers. Allow 4K for overhead in the
  100.     // various layers.
  101. #else
  102. const FW_BlockSize BestFitBlock_kMaxBlockSize = 0x00FFFFFF;
  103. #endif
  104.  
  105. class FW_CPrivBestFitBlock
  106. {
  107. public:
  108.  
  109.     enum
  110.     {
  111.         kBusyOverhead = sizeof(unsigned long), 
  112.         kMinBlockSize = sizeof(FW_SPrivBestFitBlockHeader) + sizeof(void *), 
  113.         kBlockTypeId = FW_CMemoryHeap::kBlockTypeId + 1, 
  114.         kMagicNumber = 0x3
  115.     };
  116.  
  117.  
  118.     Boolean operator>(const FW_CPrivBestFitBlock& blk) const;
  119.     Boolean operator<(const FW_CPrivBestFitBlock& blk) const;
  120.     Boolean operator>=(const FW_CPrivBestFitBlock& blk) const;
  121.     Boolean operator<=(const FW_CPrivBestFitBlock& blk) const;
  122.     Boolean operator==(const FW_CPrivBestFitBlock& blk) const;
  123.     Boolean operator!=(const FW_CPrivBestFitBlock& blk) const;
  124.     FW_CPrivBestFitBlock& operator=(const FW_CPrivBestFitBlock& blk);
  125.  
  126.     inline void operator delete(void *) { };
  127.     void* operator new(SIZE_T, void* ptr);
  128.     void* operator new(SIZE_T);
  129.  
  130.     FW_CPrivBestFitBlock(int busy,
  131.                      int prevBusy,
  132.                      long size);
  133.     FW_CPrivBestFitBlock(const FW_CPrivBestFitBlock& otherBlock);
  134.  
  135.     Boolean GetBusy() const;
  136.     FW_CPrivBestFitBlock* GetLeft() const;
  137.     unsigned int GetMagicNumber() const;
  138.     FW_CPrivBestFitBlock* GetNext() const;
  139.     FW_CPrivBestFitBlock* GetParent() const;
  140.     Boolean GetPreviousBusy() const;
  141.     FW_CPrivBestFitBlock* GetRight() const;
  142.     FW_BlockSize GetSize() const;
  143.     unsigned short GetBlockType() const;
  144.  
  145.     void SetBusy(Boolean busy);
  146.     void SetLeft(FW_CPrivBestFitBlock* left);
  147.     void SetNext(FW_CPrivBestFitBlock* fNext);
  148.     void SetParent(FW_CPrivBestFitBlock* parent);
  149.     void SetPrevBusy(Boolean busy);
  150.     void SetRight(FW_CPrivBestFitBlock* right);
  151.     void SetSize(FW_BlockSize size);
  152.     void SetBlockType(unsigned long blockType);
  153.     void SetMagicNumber(unsigned long magicNumber);
  154.  
  155.     void StuffAddressAtEnd();
  156.  
  157. protected:
  158.  
  159. private:
  160.     FW_SPrivBestFitBlockHeader fHeader;
  161. };
  162.  
  163. //----------------------------------------------------------------------------------------
  164. // FW_CPrivBestFitBlock::operator delete
  165. //----------------------------------------------------------------------------------------
  166. /*
  167. inline void FW_CPrivBestFitBlock::operator delete(void*)
  168. {
  169. }
  170. */
  171. //----------------------------------------------------------------------------------------
  172. // FW_CPrivBestFitBlock::operator new
  173. //----------------------------------------------------------------------------------------
  174.  
  175. inline void* FW_CPrivBestFitBlock::operator new(SIZE_T, void* ptr)
  176. {
  177.     return ptr;
  178. }
  179.  
  180. //----------------------------------------------------------------------------------------
  181. // FW_CPrivBestFitBlock::operator new
  182. //----------------------------------------------------------------------------------------
  183.  
  184. inline void* FW_CPrivBestFitBlock::operator new(SIZE_T)
  185. {
  186.     return NULL;
  187. }
  188.  
  189. //----------------------------------------------------------------------------------------
  190. // FW_CPrivBestFitBlock::operator>=
  191. //----------------------------------------------------------------------------------------
  192.  
  193. inline Boolean FW_CPrivBestFitBlock::operator>=(const FW_CPrivBestFitBlock& blk) const
  194. {
  195.     return *this > blk || *this == blk;
  196. }
  197.  
  198. //----------------------------------------------------------------------------------------
  199. // FW_CPrivBestFitBlock::operator<=
  200. //----------------------------------------------------------------------------------------
  201.  
  202. inline Boolean FW_CPrivBestFitBlock::operator<=(const FW_CPrivBestFitBlock& blk) const
  203. {
  204.     return *this < blk || *this == blk;
  205. }
  206.  
  207. //----------------------------------------------------------------------------------------
  208. // FW_CPrivBestFitBlock::operator!=
  209. //----------------------------------------------------------------------------------------
  210.  
  211. inline Boolean FW_CPrivBestFitBlock::operator!=(const FW_CPrivBestFitBlock& blk) const
  212. {
  213.     return !(*this == blk);
  214. }
  215.  
  216. //----------------------------------------------------------------------------------------
  217. // FW_CPrivBestFitBlock::operator=
  218. //----------------------------------------------------------------------------------------
  219.  
  220. inline FW_CPrivBestFitBlock& FW_CPrivBestFitBlock::operator=(const FW_CPrivBestFitBlock& blk)
  221. {
  222.     fHeader = blk.fHeader;
  223.     return (*this);
  224. }
  225.  
  226. //----------------------------------------------------------------------------------------
  227. // FW_CPrivBestFitBlock::FW_CPrivBestFitBlock
  228. //----------------------------------------------------------------------------------------
  229.  
  230. inline FW_CPrivBestFitBlock::FW_CPrivBestFitBlock(const FW_CPrivBestFitBlock& blk) :
  231.     fHeader(blk.fHeader)
  232. {
  233. }
  234.  
  235. //----------------------------------------------------------------------------------------
  236. // FW_CPrivBestFitBlock::GetBusy
  237. //----------------------------------------------------------------------------------------
  238.  
  239. inline Boolean FW_CPrivBestFitBlock::GetBusy() const
  240. {
  241.     return (fHeader.fBits & BestFitBlockHeader_kBusyMask) != 0 ? true : false;
  242. }
  243.  
  244. //----------------------------------------------------------------------------------------
  245. // FW_CPrivBestFitBlock::GetLeft
  246. //----------------------------------------------------------------------------------------
  247.  
  248. inline FW_CPrivBestFitBlock* FW_CPrivBestFitBlock::GetLeft() const
  249. {
  250.     return fHeader.fFreeLinks.fLeft;
  251. }
  252.  
  253. //----------------------------------------------------------------------------------------
  254. // FW_CPrivBestFitBlock::GetMagicNumber
  255. //----------------------------------------------------------------------------------------
  256.  
  257. inline unsigned int FW_CPrivBestFitBlock::GetMagicNumber() const
  258. {
  259.     return (fHeader.fBits & BestFitBlockHeader_kMagicNumberMask)
  260.                 >> BestFitBlockHeader_kMagicNumberShift;
  261. }
  262.  
  263. //----------------------------------------------------------------------------------------
  264. // FW_CPrivBestFitBlock::GetNext
  265. //----------------------------------------------------------------------------------------
  266.  
  267. inline FW_CPrivBestFitBlock* FW_CPrivBestFitBlock::GetNext() const
  268. {
  269.     return fHeader.fFreeLinks.fParent;
  270. }
  271.  
  272. //----------------------------------------------------------------------------------------
  273. // FW_CPrivBestFitBlock::GetParent
  274. //----------------------------------------------------------------------------------------
  275.  
  276. inline FW_CPrivBestFitBlock* FW_CPrivBestFitBlock::GetParent() const
  277. {
  278.     return fHeader.fFreeLinks.fParent;
  279. }
  280.  
  281. //----------------------------------------------------------------------------------------
  282. // FW_CPrivBestFitBlock::GetPreviousBusy
  283. //----------------------------------------------------------------------------------------
  284.  
  285. inline Boolean FW_CPrivBestFitBlock::GetPreviousBusy() const
  286. {
  287.     return (fHeader.fBits & BestFitBlockHeader_kPreviousBusyMask) != 0 ? true : false;
  288. }
  289.  
  290. //----------------------------------------------------------------------------------------
  291. // FW_CPrivBestFitBlock::GetRight
  292. //----------------------------------------------------------------------------------------
  293.  
  294. inline FW_CPrivBestFitBlock* FW_CPrivBestFitBlock::GetRight() const
  295. {
  296.     return fHeader.fFreeLinks.fRight;
  297. }
  298.  
  299. //----------------------------------------------------------------------------------------
  300. // FW_CPrivBestFitBlock::GetSize
  301. //----------------------------------------------------------------------------------------
  302.  
  303. inline FW_BlockSize FW_CPrivBestFitBlock::GetSize() const
  304. {
  305.     return (fHeader.fBits & BestFitBlockHeader_kSizeMask)
  306.                 >> BestFitBlockHeader_kSizeShift;
  307. }
  308.  
  309. //----------------------------------------------------------------------------------------
  310. // FW_CPrivBestFitBlock::GetBlockType
  311. //----------------------------------------------------------------------------------------
  312.  
  313. inline unsigned short FW_CPrivBestFitBlock::GetBlockType() const
  314. {
  315.     return (fHeader.fBits & BestFitBlockHeader_kBlockTypeMask)
  316.                 >> BestFitBlockHeader_kBlockTypeShift;
  317. }
  318.  
  319. //----------------------------------------------------------------------------------------
  320. // FW_CPrivBestFitBlock::SetBusy
  321. //----------------------------------------------------------------------------------------
  322.  
  323. inline void FW_CPrivBestFitBlock::SetBusy(Boolean busy)
  324. {
  325.     if (busy)
  326.         fHeader.fBits |= BestFitBlockHeader_kBusyMask;
  327.     else
  328.         fHeader.fBits &= ~BestFitBlockHeader_kBusyMask;
  329. }
  330.  
  331. //----------------------------------------------------------------------------------------
  332. // FW_CPrivBestFitBlock::SetLeft
  333. //----------------------------------------------------------------------------------------
  334.  
  335. inline void FW_CPrivBestFitBlock::SetLeft(FW_CPrivBestFitBlock* left)
  336. {
  337.     fHeader.fFreeLinks.fLeft = left;
  338. }
  339.  
  340. //----------------------------------------------------------------------------------------
  341. // FW_CPrivBestFitBlock::SetNext
  342. //----------------------------------------------------------------------------------------
  343.  
  344. inline void FW_CPrivBestFitBlock::SetNext(FW_CPrivBestFitBlock* fNext)
  345. {
  346.     // The fParent field is used both for a parent and a next pointer on different
  347.     // occasions.
  348.     
  349.     fHeader.fFreeLinks.fParent = fNext;
  350. }
  351.  
  352. //----------------------------------------------------------------------------------------
  353. // FW_CPrivBestFitBlock::SetParent
  354. //----------------------------------------------------------------------------------------
  355.  
  356. inline void FW_CPrivBestFitBlock::SetParent(FW_CPrivBestFitBlock* parent)
  357. {
  358.     fHeader.fFreeLinks.fParent = parent;
  359. }
  360.  
  361. //----------------------------------------------------------------------------------------
  362. // FW_CPrivBestFitBlock::SetPrevBusy
  363. //----------------------------------------------------------------------------------------
  364.  
  365. inline void FW_CPrivBestFitBlock::SetPrevBusy(Boolean busy)
  366. {
  367.     if (busy)
  368.         fHeader.fBits |= BestFitBlockHeader_kPreviousBusyMask;
  369.     else
  370.         fHeader.fBits &= ~BestFitBlockHeader_kPreviousBusyMask;
  371. }
  372.  
  373. //----------------------------------------------------------------------------------------
  374. // FW_CPrivBestFitBlock::SetRight
  375. //----------------------------------------------------------------------------------------
  376.  
  377. inline void FW_CPrivBestFitBlock::SetRight(FW_CPrivBestFitBlock* right)
  378. {
  379.     fHeader.fFreeLinks.fRight = right;
  380. }
  381.  
  382. //----------------------------------------------------------------------------------------
  383. // FW_CPrivBestFitBlock::SetSize
  384. //----------------------------------------------------------------------------------------
  385.  
  386. inline void FW_CPrivBestFitBlock::SetSize(FW_BlockSize size)
  387. {
  388.     fHeader.fBits &= ~BestFitBlockHeader_kSizeMask;
  389.     fHeader.fBits |= (size << BestFitBlockHeader_kSizeShift)
  390.                         & BestFitBlockHeader_kSizeMask;
  391. }
  392.  
  393. //----------------------------------------------------------------------------------------
  394. // FW_CPrivBestFitBlock::SetBlockType
  395. //----------------------------------------------------------------------------------------
  396.  
  397. inline void FW_CPrivBestFitBlock::SetBlockType(unsigned long blockType)
  398. {
  399.     fHeader.fBits &= ~BestFitBlockHeader_kBlockTypeMask;
  400.     fHeader.fBits |= (blockType << BestFitBlockHeader_kBlockTypeShift)
  401.                         & BestFitBlockHeader_kBlockTypeMask;
  402. }
  403.  
  404. //----------------------------------------------------------------------------------------
  405. // FW_CPrivBestFitBlock::SetMagicNumber
  406. //----------------------------------------------------------------------------------------
  407.  
  408. inline void FW_CPrivBestFitBlock::SetMagicNumber(unsigned long magicNumber)
  409. {
  410.     fHeader.fBits &= ~BestFitBlockHeader_kMagicNumberMask;
  411.     fHeader.fBits |= (magicNumber << BestFitBlockHeader_kMagicNumberShift)
  412.                         & BestFitBlockHeader_kMagicNumberMask;
  413. }
  414.  
  415. //----------------------------------------------------------------------------------------
  416. // FW_CPrivBestFitBlock::FW_CPrivBestFitBlock
  417. //----------------------------------------------------------------------------------------
  418.  
  419. inline FW_CPrivBestFitBlock::FW_CPrivBestFitBlock(int busy,
  420.                                           int previousBusy,
  421.                                           long size)
  422. {
  423.     SetParent(NULL);
  424.     SetRight(NULL);
  425.     SetLeft(NULL);
  426.     SetBlockType(kBlockTypeId);
  427.     SetBusy(busy);
  428.     SetPrevBusy(previousBusy);
  429.     SetSize(size);
  430.     SetMagicNumber(kMagicNumber);
  431.  
  432.     if (!busy)
  433.         this->StuffAddressAtEnd();
  434. }
  435.  
  436.  
  437. //========================================================================================
  438. // CLASS FW_CPrivBestFitSegment
  439. //
  440. //        The FW_CBestFitHeap allocates memory from the system in segments. The segments are
  441. //        linked together in a list so that When the heap is destroyed all segments can be
  442. //        freed.
  443. //
  444. //========================================================================================
  445.  
  446. class FW_CPrivBestFitSegment
  447. {
  448. public:
  449.  
  450.     friend FW_CBestFitHeap;
  451.  
  452.     enum
  453.     {
  454.         kSegmentPrefixSize = 12,
  455.         kSegmentSuffixSize = 4,
  456.         kSegmentOverhead = kSegmentPrefixSize + kSegmentSuffixSize
  457.     };
  458.  
  459.     Boolean AddressInSegment(void* ptr);
  460.  
  461. private:
  462.     void *fSegmentSpace;
  463.     unsigned long fSegmentSize;
  464.     FW_CPrivBestFitSegment *fNextSegment;
  465.     
  466.     FW_CPrivBestFitSegment(const FW_CPrivBestFitSegment& blk);
  467.     FW_CPrivBestFitSegment& operator=(const FW_CPrivBestFitSegment& blk);
  468.         // This class shouldn't be copied.
  469. };
  470.  
  471. //----------------------------------------------------------------------------------------
  472. // INLINES FW_CPrivBestFitSegment
  473. //----------------------------------------------------------------------------------------
  474.  
  475. inline Boolean FW_CPrivBestFitSegment::AddressInSegment(void* ptr)
  476. {
  477.     return ptr >= fSegmentSpace &&
  478.             ptr <= (void*) ((FW_BytePtr) fSegmentSpace + fSegmentSize);
  479. }
  480.  
  481.  
  482. //========================================================================================
  483. // CLASS FW_CPrivFreeBlockTree
  484. //
  485. //        Binary tree for storing free blocks. Dependent on the structure and
  486. //        implementation of FW_CPrivBestFitBlock.
  487. //
  488. //========================================================================================
  489.  
  490. class FW_CPrivFreeBlockTree
  491. {
  492. public:
  493.     FW_CPrivFreeBlockTree();
  494.     FW_CPrivFreeBlockTree(const FW_CPrivFreeBlockTree& blk);
  495.  
  496.     FW_CPrivFreeBlockTree& operator=(const FW_CPrivFreeBlockTree& blk);
  497.  
  498.     void AddBlock(FW_CPrivBestFitBlock* blk);
  499.     void TreeInfo(unsigned long& bytesFree,
  500.                   unsigned long& numberOfNodes) const;
  501.     void RemoveBlock(FW_CPrivBestFitBlock* blk);
  502.     FW_CPrivBestFitBlock* SearchForBlock(FW_BlockSize size,
  503.                                      void* blk,
  504.                                      FW_CPrivBestFitBlock** insertLeaf = NULL);
  505.  
  506. #ifdef FW_DEBUG
  507.     void CheckTree() const;
  508.     void PrintTree() const;
  509. #endif
  510.  
  511. protected:
  512.     FW_CPrivBestFitBlock* GetSuccessorBlk(FW_CPrivBestFitBlock* blk);
  513.     void TreeInfoHelper(FW_CPrivBestFitBlock* blk,
  514.                         unsigned long& bytesFree,
  515.                         unsigned long& numberOfNodes) const;
  516.  
  517. #ifdef FW_DEBUG
  518.     void CheckTreeHelper(FW_CPrivBestFitBlock* blk) const;
  519.     void PrintTreeHelper(FW_CPrivBestFitBlock* blk,
  520.                          int level = 0) const;
  521. #endif
  522.  
  523. private:
  524.     FW_CPrivBestFitBlock fRoot;
  525.  
  526. };
  527.  
  528.  
  529. //========================================================================================
  530. // CLASS FW_CBestFitHeap
  531. //
  532. //        Memory allocation heap using the best fit allocation strategy.
  533. //
  534. //========================================================================================
  535.  
  536. class FW_CBestFitHeap : public FW_CMemoryHeap
  537. {
  538. public:
  539.  
  540.     virtual unsigned long BytesFree() const;
  541.     virtual unsigned long HeapSize() const;
  542.  
  543.     FW_CBestFitHeap(unsigned long sizeInitial, unsigned long sizeIncrement = 0);
  544.     virtual~ FW_CBestFitHeap();
  545.  
  546.     void IBestFitHeap(); // MEB
  547.     void ExpandHeap(unsigned long sizeInitial, unsigned long sizeIncrement); // MEB
  548.  
  549. #ifdef FW_DEBUG
  550.     virtual void Check() const;
  551.     virtual Boolean IsMyBlock(void* blk) const;
  552.     virtual void Print(char* msg = "") const;
  553. #endif
  554.  
  555. protected:
  556.  
  557.     void AddToFreeBlocks(FW_CPrivBestFitBlock* blk);
  558.     FW_CPrivBestFitBlock* Coalesce(FW_CPrivBestFitBlock* blk);
  559.     void CreateNewSegment(unsigned long size);
  560.     void DeleteSegments();
  561.     void GrowHeap(unsigned long sizeIncrement);
  562.     void RemoveFromFreeBlocks(FW_CPrivBestFitBlock* blk);
  563.     FW_CPrivBestFitBlock* SearchFreeBlocks(FW_BlockSize size);
  564.  
  565.     virtual void* DoAllocate(FW_BlockSize size, FW_BlockSize& allocatedSize);
  566.     virtual FW_BlockSize DoBlockSize(const void* block) const;
  567.     virtual void DoFree(void*);
  568.     virtual void DoReset();
  569.  
  570. #ifdef FW_DEBUG
  571.     virtual void CompilerCheck();
  572.     virtual Boolean DoIsValidBlock(void* blk) const;
  573. #endif
  574.  
  575. private:
  576.     FW_CPrivBestFitSegment* fSegments;
  577.     unsigned long fSizeIncrement;
  578.     unsigned long fSizeInitial;
  579.     FW_CPrivFreeBlockTree fFreeTree;
  580.     
  581.     FW_CBestFitHeap(const FW_CBestFitHeap& blk);
  582.     FW_CBestFitHeap& operator=(const FW_CBestFitHeap& blk);
  583.         // This class shouldn't be copied.
  584. };
  585.  
  586. #endif
  587.